<%--
  Created by IntelliJ IDEA.
  User: zhangjie
  Date: 2018/9/21
  Time: 9:18 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/WEB-INF/jsp/component/common.jsp" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${frames}/css/lib/bootstrap.min.css" type="text/css">
    <link rel="stylesheet" href="${frames}/css/lib/dataTables.bootstrap.css" type="text/css">
    <%--<link rel="stylesheet" href="${frames}/css/paginate.css" type="text/css">--%>
    <%--<link rel="stylesheet" href="${frames}/css/qulitity.css" type="text/css">--%>
    <link rel="stylesheet" href="../assets/css/views/modules/_common.scss">
    <link rel="stylesheet" href="${newframe}/css/base/base.css" type="text/css">
    <link rel="stylesheet" href="${assets}/css/views/bloodScreening.css">
    <link rel="stylesheet" href="${assets}/css/views/department/departmentMgr.css">
    <script src="../assets/js/views/vue.min.js"></script>
    <script src="${js}/jquery-1.9.1.min.js"></script>
    <script src="${js}/jquery.dataTables.js"></script>
    <link href="../assets/css/bootstrap-datetimepicker.css" type="text/css">
    <script src="../assets/js/bootstrap-datetimepicker.min.js"></script>
    <script src="${frames}/Chronic/laydate/laydate.js"></script>
    <script src="${assets}/js/views/bpAbnormal.js"></script>
    <%-- 时间格式化封装 --%>
    <script src="../assets/js/views/dateChange.js"></script>
    <%@ include file="/WEB-INF/jsp/component/commonBottom.jsp" %>
    <script type="text/javascript" src="../assets/js/echarts.js"></script>
    <style>
        .color{
            margin:0 !important;
        }
        span{
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            font-family: PingFang-SC-Regular;
        }
        .illness span{
            height: 16px;
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
        }
        .btn{
            float:right ;
            width:100px;
            font-size:16px;
            line-height:28px;
            background:#35acfd !important;
            margin-right:15px !important;
            padding:0 !important;
        }
        .title{
            font-family: MicrosoftYaHei;
            font-size: 16px !important;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0.3px;
            color: #666666;
        }
        label{
            height: 16px;
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
        }
        /* 随访时间及方式 */
        .way,illness,sign,live,evaluate{
            margin-bottom:30px;
        }
        .way_content,illness_content{
            width:100%;
            margin-left:15px;
            margin-top:19px;
        }
        .way_content label{
            width:auto;
        }
        .way_content input,#accompanyType{
            width: 181px;
            line-height: 30px;
            height:30px;
            border: solid 1px #d0d0d0;
            font-family: MicrosoftYaHei;
            font-size: 15px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px !important;
        }
        /* 病症 */
        .illness_content{
            margin-left:15px;
            margin-bottom:20px;
        }
        .illness_content label{
            margin-left:22px;
        }
        input[type=checkbox] {
            width:20px;
            height:20px;
            -webkit-appearance: none;
            border-radius:5px;
            border:1px solid #9e9e9e;
            vertical-align:top;
            margin-top:7px;
            display:inline-block !important;
        }
        input[type=checkbox]:checked{
            background-image: url('../assets/images/radio.png');
            background-size:100% 100%;
            border:none
        }
        .ill1{
            margin-right:22px;
            margin-top:20px;
        }
        /* 体征 */
        .sign_content{
            margin-left:15px;
            margin-top:20px;
            margin-bottom:20px;
        }
        .sign_content div input{
            width:180px;
            line-height: 30px;
            border: solid 1px #d0d0d0;
            text-indent:10px;
            position:absolute;
            height:30px;
            display:inline-block;
        }
        .sign_content div span{
            position:relative;
            left:130px;
        }
        .sign_content div{
            display:inline-block;
            width:270px;
        }
        .second div input{
            width:135px;
        }
        .second div span{
            left:80px;
        }
        /*.second div{*/
        /*width:230px;*/
        /*}*/
        .third div input{
            width:135px;
        }
        .third div span{
            left:80px;
        }
        .third div{
            width:200px;
        }
        /* 生活方式调查 */
        .live_content{
            margin-left:15px;
            margin-top:20px;
        }
        .live_content span{
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
            margin-right:19px;
            display:inline-block;
        }
        .live_content input{
            width: 115px;
            height: 30px;
            border: solid 1px #d0d0d0;
            line-height:30px;
            margin-right:10px;
            text-indent:10px;
        }
        .live_content div{
            margin-top:20px;
        }
        .sprots span{
            margin-right:65px;
        }
        #salt{
            width: 181px;
            height: 30px;
            border: solid 1px #d0d0d0;
            font-family: MicrosoftYaHei;
            font-size: 15px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px;
            margin-right:19px;
        }
        .salt input{
            width: 180px;
            height: 30px;
            border: solid 1px #d0d0d0;
            line-height:30px;
            margin-right:10px;
            text-indent:10px;
        }
        .mentality{
            margin-bottom:20px;
        }
        select{
            width: 181px;
            height: 30px;
            border: solid 1px #d0d0d0;
            font-family: MicrosoftYaHei;
            font-size: 15px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px;
            margin-right:19px;
        }
        .salttype{
            width: 200px;
            height: 30px;
        }
        /* 随访评估 */
        .evaluate_content{
            margin-left:15px;
            margin-bottom:20px;
            margin-top:20px;
        }
        .evaluate_content span{
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
            margin-right:19px;
            display:inline-block;
        }
        /* 治疗建议 */
        .suggest_content{
            margin-left:15px;
            margin-bottom:20px;
            margin-top:20px;
        }
        .suggest_content span{
            font-family: PingFang-SC-Regular;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0px;
            color: #666666;
            margin-right:19px;
            display:inline-block;
        }
        .suggest_content textarea{
            width: 500px;
            height: 120px;
            border: solid 1px #d0d0d0;
            vertical-align:top
        }
        /*  表格 */
        #example th,
        #medicalTable th{
            height: 30px;
            background-color: #e6e6e6;
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #666666;
        }
        #example td,
        #medicalTable td{
            text-align:center;
            height: 17px;
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
        }
        #mytool{
            width:96%;
        }
        #example_paginate{
            margin-top:15px;
            width:100%;
            text-align: center;
            margin-bottom:40px;
        }
        #medicalTable_paginate{
            text-align: center;
        }
        #medicalTable tbody tr:nth-child(even){
            background: rgba(250,250,255,1)
        }
        #medicalTable tbody tr:nth-child(odd){
            background:rgba(255,255,255,0.2);
        }
        button{
            margin-top:0px !important;
        }
        .btn{
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            letter-spacing: 0.3px;
            color: #ffffff;
        }
        textarea{
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px;
        }
        input{
            text-indent:10px;
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
        }
        .content{
            height:auto !important;
        }
        .illness{
            box-shadow:none !important
        }
        .dataTables_empty{
            line-height:30px;
        }
        .default{
            border:1px solid red !important;
        }
        input{
            display:inline-block !important;
        }
        .warn{
            padding:30px;
            width:90% !important;
            background:#e6e6e6;
        }
        .warn ul li{
            font-family: MicrosoftYaHei;
            font-size: 16px;
            font-weight: normal;
            font-stretch: normal;
            line-height: 30px;
            letter-spacing: 0px;
            color: #333333;
            text-indent:10px;
        }
        input[type=radio] {
            width:20px;
            height:20px;
            vertical-align:middle;
            -webkit-appearance: none;
            margin:0 !important;
            border-radius:50%;
            background-image: url('../assets/images/nocheck.png');
            background-size:100% 100%
        }
        input[type=radio]:checked{
            background-image: url('../assets/images/checkout.png');
            background-size:100% 100%
        }
        .default{
            border:1px solid red !important;
        }
        select{
            margin-top:20px;
            width:50%;
        }
        .inputVal{
            position:absolute;
            height:30px;
        }
        .inputText{
            position:relative;
        }
    </style>
</head>
<body>
<div>
    <%@ include file="../../breadline.jsp" %>
</div>
<div id="main" class="wrap">
    <div>
        <%@ include file="../../personalnews.jsp" %>
    </div>
    <div class="illness" style="width:99%; margin-right:19px;">
        <div class="tableWrap" style="padding-bottom:20px;background-color: #ffffff;box-shadow: 0 3px 7px 0 rgba(0, 0, 0, 0.05);">
            <div style="margin-left:20px;padding-top:20px;">
                <h3 style="margin-bottom:16px;">随访信息</h3>
            </div>
            <div style="margin-left:19px;margin-bottom:10px;">
                <div class="test" style="border-bottom:1px solid #e6e6e6;">
                    <div style="width:100%;overflow:hidden;margin-bottom:10px;">
                        <span style="margin-right:10px;width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle"></span>
                        <span class="title">血脂趋势</span>
                        <button type="button" class="btn btn-info" @click="Morebf()" v-show="xzqs">更多</button>
                    </div>
                    <div class="bfchart">

                    </div>
                    <p v-show="!chartBf" style="text-align:center;margin:30px 0;">暂无数据</p>
                </div>
            </div>
            <div style="margin-left:19px;">
                <div class="way">
                    <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                    <span class="title">随访时间及方式</span>
                    <button type="button" class="btn btn-info" @click="pressure()">
                        <img src="../assets/images/revise.png" alt="" style="width:16px;vertical-align: middle;">  保存
                    </button>
                    <div class="way_content">
                        <div>
                            <label for="">随访日期：</label>
                            <div class="input-group date form_date" data-date-format="yyyy-mm-dd" style="display:inline-block !important">
                                <input id="beginDate" type="text" class="lay-date" readonly >
                            </div>
                            <label for="" style="margin-left:40px;">随访方式：</label>
                            <%-- 随访方式 下拉 --%>
                            <select id="accompanyType" name="accompanyType" class="SN" v-model="bfData.accompanyType">
                                <medi:configOpt name="accompanyType"/>
                            </select>
                            <%--<label for="" style="margin-left:20px;">随访医师：</label>--%>
                            <%--<input type="text" v-model="bfData.doctorName">--%>
                        </div>
                        <div style="margin-top:25px;">
                            <label for="" style="">下次随访：</label>
                            <div class="input-group date form_date" data-date-format="yyyy-mm-dd" style="display:inline-block !important">
                                <input id="nextDate" type="text" class="lay-date"  readonly >
                            </div>
                            <label for="" style="margin-left:40px;">测血脂值：</label>
                            <input type="text" class="inputVal" v-model="bfData.bloodFat">
                            <span class="inputText" style="left:110px;">mmol/L</span>
                        </div>
                        <div style="margin-top:25px;">
                            <span class="title" style="line-height:100%;">体重、身高、BMI指数及变化情况：</span>
                            <div style="margin-top:25px;">
                                <div style="display:inline-block">
                                    <label for="">身高：</label>
                                    <input type="text" v-model="bfData.height">
                                    <span class="inputText" style="left:-35px;" >cm</span>
                                </div>
                                <div style="display:inline-block">
                                    <label for="" style="margin-left:40px;">体重：</label>
                                    <input type="text" style="left:200px;" v-model="bfData.weight">
                                    <span class="inputText" style="left:-35px;" >kg</span>
                                </div>
                                <div style="display:inline-block">
                                    <label for="" style="margin-left:40px;">BMI：</label>
                                    <input type="text" style="left:200px;" v-model="bfData.bmi">
                                    <span class="inputText" style="left:-35px;" >kg/m²</span>
                                </div>
                            </div>
                        </div>
                        <div style="margin-top:25px;">
                            <div style="display:inline-block">
                                <label for="">甘油三酯：</label>
                                <input type="text" v-model="bfData.triglyceride">
                                <span class="inputText" style="left:-65px;" >mmol/L</span>
                            </div>
                            <div style="display:inline-block">
                                <label for="" style="margin-left:40px;">总胆固醇：</label>
                                <input type="text" style="left:200px;" v-model="bfData.cholesterol">
                                <span class="inputText" style="left:-65px;" >mmol/L</span>
                            </div>
                        </div>
                        <div style="margin-top:25px;">
                            <div style="display:inline-block">
                                <label for="">高密度胆固醇：</label>
                                <input type="text" v-model="bfData.highCholesterol">
                                <span class="inputText" style="left:-65px;" >mmol/L</span>
                            </div>
                            <div style="display:inline-block">
                                <label for="" style="margin-left:40px;">低密度胆固醇：</label>
                                <input type="text" v-model="bfData.lowCholesterol">
                                <span class="inputText" style="left:-65px;" >mmol/L</span>
                            </div>
                        </div>
                        <div style="margin-top:25px;">
                            <span class="title">目前症状及并发症情况:</span>
                            <div style="margin-top:10px;">
                                <textarea v-model="bfData.symptomInfo" type="text" placeholder="请输入内容" style="display:inline-block;width:80%;height:120px;margin-top:20px;border:1px solid rgb(208, 208, 208)" class="form-control medicalMsg"></textarea>
                            </div>
                        </div>
                        <div style="margin-top:25px;">
                            <span class="title">目前用药情况（药名、剂量、用法、服药情况）及不良反应:</span>
                            <div style="margin-top:10px;">
                                <select name="medical" id="medical" v-model="bfData.medical">
                                    <option value>请选择</option>
                                    <option value="1">偶治：1年服药时间少于3个月</option>
                                    <option value="2">间断：1年服药时间3-9个月</option>
                                    <option value="3">规律：1年服药时间≥9个月）</option>
                                </select>
                            </div>
                        </div>
                        <div style="margin-top:25px;">
                            <span class="title">未规律服药原因:</span>
                            <div style="margin-top:10px;">
                                <select name="unLawMedical" id="unLawMedical" v-model="bfData.unLawMedical">
                                    <option value>请选择</option>
                                    <option value="1">经济原因</option>
                                    <option value="2">忘记</option>
                                    <option value="3">不良反应</option>
                                    <option value="4">配药不方便</option>
                                    <option value="5">不需药物治疗</option>
                                </select>
                            </div>
                        </div>
                        <div style="margin-top:25px;">
                            <span class="title">目前采取的非药物干预方法:</span>
                            <div style="margin-top:10px;">
                                <div style="display:inline-block;width:75%;margin-bottom:0px;vertical-align:top;"  id="interventionMethod" ref="interventionMethod">
                                        <span class="ill1" v-for="(item,key) in interventionMethod" :key="key">
                                            <input type="checkbox" :name="item.checkName" :checked="item.check" :value="item.id" :id="item.forId" @click="unLawMedicalCheck(item)"/>
                                            <label :for="item.forId">{{item.name}}</label>
                                        </span>
                                </div>
                            </div>
                        </div>
                        <div style="margin-top:25px;">
                            <span class="title">个体化指导建议:</span>
                            <div style="margin-top:10px;">
                                <div style="display:inline-block;width:75%;margin-bottom:0px;vertical-align:top;"  id="proposal" ref="proposal">
                                        <span class="ill1" v-for="(item,key) in proposal" :key="key">
                                            <input type="checkbox" :name="item.checkName" :checked="item.check" :value="item.id" :id="item.forId" @click="proposalCheck(item)"/>
                                            <label :for="item.forId">{{item.name}}</label>
                                        </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="way" style="margin-top:15px;">
                <span style="width:5px;padding-bottom:25px;background-color:#35acfd;display:inline-block;vertical-align:middle;margin-right:10px;"></span>
                <span class="title">随诊药物使用信息</span>
                <div class="way_content">
                    <div>
                        <label for="prescribingDrugs">此次诊疗是否开药：</label>
                        <select name="prescribingDrugs" style="width:200px;" id="prescribingDrugs" v-model="bfData.prescribingDrugs">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="2">否</option>
                        </select>
                        <label for="prescribingDrugsPre" style="margin-left:20px;">是否在上次用药方案基础上完善此次药物信息？：</label>
                        <select name="prescribingDrugsPre" style="width:200px;" id="prescribingDrugsPre" v-model="bfData.prescribingDrugsPre" @change="chengSelect()">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <%--<option value="2">否</option>--%>
                        </select>
                    </div>
                    <div>
                        <div style="margin-bottom:10px;height:30px;width:95%;margin-top:20px;">
                            <button type="button" class="btn btn-info" @click="deletMedical()" style="margin-right:20px;margin-top:20px;" >
                                删除
                            </button>
                            <button type="button" class="btn btn-info" @click="UpdateMedical()" style="margin-right:20px;margin-top:20px;" >
                                修改
                            </button>
                            <button type="button" class="btn btn-info" @click="toAddMedical()" style="margin-right:20px;margin-top:20px;">
                                新增
                            </button>
                        </div>
                    </div>
                    <div>
                        <div id="table">
                            <table id="example" class="display" cellspacing="10" width="95%">
                                <thead>
                                <tr>
                                    <th></th>
                                    <th>商品类别</th>
                                    <th>化学名称</th>
                                    <th>商品名称</th>
                                    <th>单次用量</th>
                                    <th>使用频率</th>
                                    <th>给药方式</th>
                                    <th>用法</th>
                                    <th>是否停用</th>
                                </tr>
                                </thead>
                                <tbody v-if="medicalList.length != 0">

                                </tbody>
                            </table>
                            <p v-if="medicalList.length == 0" style="text-align:center;color:black;line-height:30px;">暂无数据</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div style="width:99%; margin-right:19px;margin-top:20px;" class="content">
        <div style="padding-bottom:20px;background-color: #ffffff;box-shadow: 0 3px 7px 0 rgba(0, 0, 0, 0.05);">
            <div style="margin-left:19px;">
                <div class="first_news">
                    <div class="news" style="margin-top:15px;margin-bottom:16px;">
                        <h3>用药信息</h3>
                        <button type="button" class="btn btn-info" @click="deletMedical()" style="margin-top:20px;">删除</button>
                        <button type="button" class="btn btn-info" @click="updateMedical()" style="margin-right:20px;margin-top:20px;">
                            修改
                        </button>
                        <button type="button" class="btn btn-info" @click="addMedical()" style="margin-right:20px;margin-top:20px;" >
                            新增
                        </button>
                    </div>
                    <div id="tablepart">
                        <table id="medicalTable" class="display" cellspacing="10" width="99%">
                            <thead>
                            <tr>
                                <th style="width:25px;">&nbsp;</th>
                                <th>序号</th>
                                <th style="display:1%;"></th>
                                <th>药名</th>
                                <th>数量（剂量）</th>
                                <th>规格</th>
                                <th>频度（次數）</th>
                                <th>开立医生</th>
                                <th>开立时间</th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
  var vm = new Vue({
    el : "#main",
    data: {
      infor: [],//病人基本信息data
      idCard:'',
      id:'',
      add:false,
      way:'',
      diseasesType:'',
      slide:false,
      beginDate:'',
      nextDate:'',
      bfData:{
        prescribingDrugs:'',
        prescribingDrugsPre:'',
        accompanyTime:'',
        nextAccompanyTime:'',
        accompanyType:'',
        triglyceride:'',
        cholesterol:'',
        highCholesterol:'',
        lowCholesterol:'',
        bloodFat:'',
        proposal:'',
        doctorName:'',
        changeInfo:'',
        symptomInfo:'',
        medical:'',
        unLawMedical:'',
        interventionMethod:''
      },
      accompanyTime:'',
      nextAccompanyTime:'',
      synchronous:false,
      btnText:'',
      dis:false,
      Type:'',
      BfInfo:{
        data:[],
        data1:[],
        data2:[],
        firstjson:[],
        secondjson:[],
        thirdjson:[],
        fourthjson:[],
        fifthjson:[],
        sixthjson:[],
        seventhjson:[]
      },
      chartBf:true,
      xzqs:true,
      interventionMethod:[
        {
          check:false,
          id:'1',
          name:'饮食控制',
          forId:'unLawMedical1',
          checkName:'unLawMedical'
        },
        {
          check:false,
          id:'2',
          name:'规律活动',
          forId:'unLawMedical2',
          checkName:'unLawMedical'
        },
        {
          check:false,
          id:'3',
          name:'减少吸烟量或戒烟',
          forId:'unLawMedical3',
          checkName:'unLawMedical'
        },
        {
          check:false,
          id:'4',
          name:'减少饮酒或戒酒',
          forId:'unLawMedical4',
          checkName:'unLawMedical'
        },
        {
          check:false,
          id:'5',
          name:'减轻体重',
          forId:'unLawMedical5',
          checkName:'unLawMedical'
        },
        {
          check:false,
          id:'6',
          name:'未采取任何方法',
          forId:'unLawMedical6',
          checkName:'unLawMedical'
        },
      ],
      proposal:[
        {
          check:false,
          id:'1',
          name:'药物治疗',
          forId:'proposal1',
          checkName:'proposal'
        },
        {
          check:false,
          id:'2',
          name:'膳食和体力活动',
          forId:'proposal2',
          checkName:'proposal'
        },
        {
          check:false,
          id:'3',
          name:'血脂控制等方面',
          forId:'proposal3',
          checkName:'proposal'
        }
      ],
      medicalList:[]
    },
    methods:{
      getNowFormatDate() {
        var date = new Date();
        var seperator1 = "-";
        var year = date.getFullYear();
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
          month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
          strDate = "0" + strDate;
        }
        var currentdate = year + seperator1 + month + seperator1 + strDate;
        return currentdate;
      },
      isNull(data){
        if( data == null ){
          data = ''
        }
        return data
      },
      showMoreCheck(locaData,data){
        data = data.split(',');
        for( var a = 0; a < locaData.length; a++ ){
          for( var i = 0; i < data.length; i++ ){
            if( locaData[a].id == data[i] ){
              locaData[a].check = true
            }
          }
        }
      },
      unLawMedicalCheck(item){
        let that = this;
        that.bfData.interventionMethod = that.getSelectArray(that.bfData.interventionMethod,item);
        console.log(that.bfData.interventionMethod)
      },
      proposalCheck(item){
        let that = this;
        that.bfData.proposal = that.getSelectArray(that.bfData.proposal,item);
      },
      getSelectArray(data,item){
        console.log(data)
        if( data == '' ){
          data = []
        }else if( data.constructor != Array ){
          data = data.split(',')
        }
        if( !item.check ){
          item.check = true;
          data.push(item.id)
        }else{
          item.check = false;
          var index = data.indexOf(item.id);
          if (index > -1) {
            data.splice(index, 1);
          }
        }
        return data
      },
      Morebf:function(){
        let that = this;
        // 更多检验项目
        $.ajax({
          url:"${URL_SCREENING_GETBREADLINE}",
          dataType:'json',
          type:'post',
          success:function(data){
            breadLine = JSON.parse(data.data)
            var url = '${URL_BF_TOMOREBFINFO}?idCard=' + that.infor.idcard+'&diseasesType='+that.diseasesType+'&type='+that.Type
            breadLine.push({
              name:'高血脂',
              href:url
            })
            $.ajax({
              url:'${URL_SCREENING_SAVEBREADLINE}',
              data:{
                breadLine:JSON.stringify(breadLine)
              },
              dataType:'json',
              type:'post',
              success:function(data){
                parent.showSrc('${URL_BF_TOMOREBFINFO}?idCard=' + that.infor.idcard+'&diseasesType='+that.diseasesType+'&type='+that.Type)
              }
            })
          }
        })
      },
      //修改病人基本信息
      addDevice : function (){
        let that= this;
        window.parent.showNewModelIframe("${URL_PATIENT_PATIENT}?id="+that.infor.id+'&diseasesType='+that.diseasesType,800,650);
      },
      Synchronous(e){
        let that = this
        $.ajax({
          url:'${URL_PATIENT_UPDATEPATIENT}',
          data:{
            id:that.infor.id,
            synchronization:'1'
          },
          type:'post',
          dataType:'json',
          success:function(data){
            console.log(data)
            if(data.success){
              e.target.disabled = true;
              e.target.innerText = '正在同步'
              that.setTime()
            }else{
              window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+data.msg,300,200)
            }
          }
        })
      },
      setTime(){
        let that = this
        setInterval(function(){
          $.ajax({
            url:'${URL_PATIENT_UPDATEPATIENT}',
            data:{
              id:that.infor.id,
              synchronization:'1'
            },
            type:'post',
            dataType:'json',
            success:function(data){

            }
          })
        },10000)
      },
      deletMedical(){
        // 获取id
        let that = this;
        var checkedArray = []
        var input = $('.check_id');
        for( var a = 0; a < input.length; a++ ){
          if( input[a].checked ){
            checkedArray.push(input[a])
          }
        }
        if( checkedArray.length == 0 ){
          var str = '请勾选一条以上数据删除'
          window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+ encodeURI(encodeURI(str)),380,220)
        }else{
          var ids = [];
          for( var a = 0; a < checkedArray.length; a++ ){
            ids.push(checkedArray[a].value)
          }
          var r = confirm("确定要删除勾选的数据吗?");
          if (r == true) {
            var arr = []
            for( var a = 0; a < that.medicalList.length; a++ ){
              for( var  i = 0; i < ids.length; i++ ){
                if( that.medicalList[a].id != ids[i] ){
                  arr.push(that.medicalList[a])
                }
              }
            }
            that.medicalList = arr;
            for( var a = 0; a < input.length; a++ ){
              input[a].checked = false
            }
          }
        }
      },
      UpdateMedical(){
        let that = this;
        var checkedArray = []
        var input = $('.check_id');
        for( var a = 0; a < input.length; a++ ){
          if( input[a].checked ){
            checkedArray.push(input[a])
          }
        }
        if( checkedArray.length != 1 ){
          var str = '请勾选一条数据修改'
          window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+ encodeURI(encodeURI(str)),380,220)
        }else{
          var td = checkedArray[0].parentNode.parentNode.childNodes;
          var id = td[0].firstElementChild.value
          window.parent.showNewModelIframe('${URL_BLONELOOSE_CHECK}?idCard=' + that.idCard+ '&checkId='+that.id +'&id='+id,800,600);
        }
      },
      toAddMedical(){
        let that = this;
        window.parent.showNewModelIframe('${URL_BLONELOOSE_CHECK}?idCard=' + that.idCard+ '&checkId='+that.id + '&id='+'',800,600);
      },
      pressure(){
        let that = this
        // 获取数据
        // 随访时间及方式
        that.bfData.accompanyType = $('#accompanyType option:selected').attr('value');;
        var app = [];
        if( $('#accompanyType option:selected').attr('value') === "" ){
          $('#accompanyType').addClass('default')
          app.push($('#accompanyType'))
        }else{
          if( $('#accompanyType').hasClass('default')){
            $('#accompanyType').removeClass('default')
          }
        }
        if(app[0]){
          var offset = $(app[0]).offset().top
          parent.$("html,body").animate({ scrollTop: offset}, 0);
          return
        }
        $.ajax({
          url:'${URL_ACCOMPANY_SAVEBF}',
          data:{
            id:that.way,
            idCard:that.idCard,
            // 随访时间
            accompanyTime:$('#beginDate').val(),
            // 下次随访时间
            nextAccompanyTime:$('#nextDate').val(),
            // 随访方式
            accompanyType:that.bfData.accompanyType,
            // 甘油三酯
            triglyceride:that.bfData.triglyceride,
            // 总胆固醇
            cholesterol:that.bfData.cholesterol,
            // 高密度胆固醇
            highCholesterol:that.bfData.highCholesterol,
            // 低密度胆固醇
            lowCholesterol:that.bfData.lowCholesterol,
            // 血脂
            bloodFat:that.bfData.bloodFat,
            // 个体化指导建议
            proposal:that.bfData.proposal.toString(),
            medical:that.bfData.medical,
            unLawMedical:that.bfData.unLawMedical,
            interventionMethod:that.bfData.interventionMethod.toString(),
            changeInfo:that.bfData.changeInfo,
            doctorName:that.bfData.doctorName,
            symptomInfo:that.bfData.symptomInfo,
            changeInfo:that.bfData.changeInfo,
            height:that.bfData.height,
            weight:that.bfData.weight,
            bmi:that.bfData.bmi
          },
          dataType:'json',
          type:'post',
          success:function(data){
            if( data.success ){
              $.ajax({
                url:"${URL_SCREENING_GETBREADLINE}",
                dataType:'json',
                type:'post',
                success:function(data){
                  breadLine = JSON.parse(data.data)
                  var url = '${URL_ACCOMPANY_BFACCOMPANYS}?idcard=' + that.idCard + '&id=' + that.id +'&diseasesType='+ that.diseasesType
                  breadLine = breadLine.slice(0,breadLine.length-1)
                  $.ajax({
                    url:'${URL_SCREENING_SAVEBREADLINE}',
                    data:{
                      breadLine:JSON.stringify(breadLine)
                    },
                    dataType:'json',
                    type:'post',
                    success:function(data){
                      parent.showSrc('${URL_ACCOMPANY_BFACCOMPANYS}?idcard=' + that.idCard + '&id=' + that.id +'&diseasesType='+ that.diseasesType)
                    }
                  })
                }
              })
            }
          }
        })
      },
      // 获取选中的数据
      getSelectData(element){
        var str = '';
        var strList = [];
        for ( var a = 0; a < element.length; a++ ){
          if( element[a].checked ){
            strList.push(element[a].value)
          }
        }
        str = strList.toString();
        return str
      },
      // 数据回显
      showSelectData(element,data){
        var arr = '';
        if( data.split(',') ){
          arr = data.split(',')
        }else{
          arr = data;
        }
        for( var a = 0; a < element.length; a++ ){
          if( arr instanceof Array ){
            for( var  i = 0; i < arr.length; i++  ){
              if( arr[i] == a+1 ){
                element[a].checked = true
              }
            }
          }else{
            if(  arr == a+1 ){
              element[a].checked = true
            }
          }
        }
      },
      // 创建用药信息表格
      initMedicalTable(){
        let that = this;
        var idCard = '${URL_PATIENT_MEDICALINFO}?idCard='+ that.idCard;
        table= $('#medicalTable').DataTable({
          "dom": "<'row'<'#mytool.col-xs-10'><'col-xs-6'f>r>" +
            "t" +
            "<'row'<''i><''p>>",
          "bFilter": false,//去掉搜索框
          "bAutoWidth": true, //自适应宽度
          "info": false,
          "bSort": false,
          "sPaginationType" : "full_numbers",
          "ordering": false,//是否允许Datatables开启排序
          "bProcessing" : true,
          "bServerSide" : true,
          "searching" : false, //去掉搜索框方法一
          'lengthChange' : false,
          "oPaginate":false,
          "lengthMenu": [10],
          "sAjaxSource":idCard,
          "sAjaxDataProp": "list",//查询后，返回的集合
          "fnServerData": function ( sSource, aoData, fnCallback ) {  //查询条件
            $.ajax( {
              "dataType": 'json',
              "url": sSource,
              "type":'post',
              "data": aoData,
              "success": function(resp){
                fnCallback(resp.data)
              }
            } );
          },
          "aoColumns" : [{
            "targets": 0,
            "data": null,
            "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
              $(nTd).html('<input class="all_id" type="checkbox">'+'<span style="display:none;">'+ oData.type +'</span>')
            }

          },{
            "targets": 1,
            "data": null,
            "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
              $(nTd).text(oData.id)
              $(nTd).attr('title',oData.id)
            }
          },{
            "targets": 2,
            "data": null,
            "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
              $(nTd).html('<span style="display:none">'+oData.useType+'</span>')
            }
          },{
            "targets": 3,
            "data": null,
            "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
              $(nTd).text(oData.medicalName)
              $(nTd).attr('title',oData.medicalId)
            }
          },{
            "mDataProp" : "numbers"
          },{
            "mDataProp" : "medicalSpecs"
          },{
            "mDataProp" : "medicalFrequency"
          },{
            "targets": 7,
            "data": null,
            "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
              var doctor;
              if( oData.doctorName == null ){
                doctor = ""
              }else{
                doctor = oData.doctorName
              }
              $(nTd).text(doctor)
            }
          },{
            "targets": 8,
            "data": null,
            "fnCreatedCell": function (nTd, sData, oData, iRow, iCol) {
              if( oData.recordTime != null ){
                oData.recordTime = oData.recordTime.slice(0,10)
              }else{
                oData.recordTime = ''
              }
              $(nTd).text(oData.recordTime)
            }
          }],
          "oLanguage": {//插件的汉化
            "sLengthMenu": "32",
            "sZeroRecords" : "抱歉， 没有找到",
            "sInfoEmpty" : "没有数据",
            "sInfoFiltered" : "(从 _MAX_ 条数据中检索)",
            "oPaginate" : {
              "sFirst" : "",
              "sPrevious" : "<b>上一页<b>",
              "sLast" : "",
              "sNext" : "<i>下一页</i>"

            },
            "sZeroRecords" : "没有检索到数据",
            "sProcessing" : "<img src='' />",
            "sSearch" : "搜索"
          }
        })
      },
      // 新增用药信息
      addMedical(){
        let that = this;
        // 新增用药信息页面 跳转
        // 获取病人id
        window.parent.showNewModelIframe('${URL_PATIENT_TOADDMEDICAL}?id='+that.infor.id + '&idCard=' + that.infor.idcard+'&diseasesType='+that.diseasesType,680,600);
      },
      updateMedical(){
        // 判断是否选中
        let that = this;
        var checkedArray = []
        var input = $('.all_id')
        for( var a = 0; a < input.length; a++ ){
          if( input[a].checked ){
            checkedArray.push(input[a])
          }
        }
        if( checkedArray.length != 1 ){
          var str = '请勾选一条数据修改'
          window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+ encodeURI(encodeURI(str)),380,220)
          return
        }else{
          var td = checkedArray[0].parentNode.parentNode.childNodes
          console.log(td)
          var medicalFrequency = encodeURI(td[6].innerText)
          var medicalSpecs = encodeURI(td[5].innerText)
          var numbers = td[4].innerText
          var userType = td[2].innerText;
          var id = td[1].title
          console.log(id)
          var medicalId = td[3].title
          var medicalname = encodeURI(td[3].innerText)
          var recordTime = td[8].innerText
          window.parent.showNewModelIframe('${URL_PATIENT_TOUPDATEMEDICAL}?id=' + id
            + '&medicalId=' + medicalId + '&idCard=' + that.idCard + '&medicalFrequency=' + medicalFrequency +
            '&numbers=' + numbers + '&medicalname=' + medicalname + '&diseasesType='+that.diseasesType+
            '&recordTime='+recordTime+'&medicalSpecs='+medicalSpecs+'&userType='+userType,800,650);
        }
      },
      deletMedical(){
        let that = this;
        var checkedArray = []
        var input = $('.all_id')
        for( var a = 0; a < input.length; a++ ){
          if( input[a].checked ){
            checkedArray.push(input[a])
          }
        }
        if( checkedArray.length != 1 ){
          var str = '请勾选一条数据修改'
          window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+ encodeURI(encodeURI(str)),380,220)
        }else{
          let type = checkedArray[0].parentNode.childNodes[1].innerText
          var td = checkedArray[0].parentNode.parentNode.childNodes
          var id = td[1].firstChild.data;
          if( type != 1 ){
            window.parent.showNewModelIframe('${URL_COMMON_TOTIPS}?title='+'该记录由医院同步,不能进行操作',300,200)
            return
          }
          $.ajax({
            url:"${URL_PATIENT_DELETEMEDICALINFO}",
            dataType:'json',
            type:'post',
            data:{
              ids : id
            },
            success:function(data){
              refreshTable();
            }
          })
        }
      }
    },
    mounted() {
      let that = this;
      initLayDate('#beginDate');
      initLayDate('#nextDate');
      var href = location.search.split('?')[1];
      console.log(href)
      that.idCard = href.split('&')[0].split('=')[1];
      that.id = href.split('&')[1].split('=')[1];
      that.showCurd = true;
//            // 初始化获取默认今天
      $.ajax({
        url:"${URL_PATIENT_MEDICALINFO}",
        type:'post',
        dataType: "json",
        data:{
          idCard:that.idCard,
          iDisplayStart:0,
          iDisplayLength:5
        },
        success:function(data){
          console.log(data)
          that.medical = data.data.list;
          $('#example1').DataTable({
            data: that.medical,
            //使用对象数组，一定要配置columns，告诉 DataTables 每列对应的属性
            columns: [
              { data: 'check' },
              { data: 'olderNumber' },
              { data: 'id' },
              { data: 'medicalName' },
              { data: 'numbers' },
              { data: 'medicalSpecs' },
              { data: 'medicalFrequency' },
              { data: 'useType' },
              { data: 'doctorName' },
              { data: 'recordTime' }
            ],
            lengthChange : false,
            paging : false,
            searching : false,
            info: false,
            bAutoWidth: true,
          })
//                         绑定药名id
          var tr = $('#example1 tbody tr')
          for( var a = 0; a < that.medical[0].length; a++ ){
            $(tr[a])[0].children[2].title = that.medical[0][a].medicalId
            $(tr[a])[0].children[2].value = that.medical[0][a].id
          }
        }
      })
      $.ajax({
        url:"${URL_BF_PATIENTBFTESTS}",
        type:"post",
        dataType:"json",
        data:{
          idCard:that.idCard
        },
        success:function(data){
          // 判断数据是否有值
          if( data.dataList.length === 0){
            // 显示暂无数据
            that.chartBf = false;
            that.xzqs = false;
          }else{
            // 动态插入 echart dom
            var str = $("<div></div>")
            // 添加 id 名称
            $(str).attr('id','chartbf');
            // 插入dom节点内容
            $(".bfchart").append(str)
            // 添加曲线图样式
            $("#chartbf").css({
              'width':"97%",
              "height": "320px"
            })
            // 显示曲线图
            that.chartBf = true;
            // 截取数据长度 部分显示
            var dataJosn;
            if( data.dataList.length > 7 ){
              dataJosn = data.dataList.slice(0,7).reverse()
            }else{
              dataJosn = data.dataList.reverse()
            }
            for( var a = 0; a < dataJosn.length; a++ ){
              // 将code为105001的数据添加到新数组中
              // 获取空腹血压数据
              // 获取检测时间
              // 总胆固醇
              that.BfInfo.secondjson.push(dataJosn[a].valueTg);
              that.BfInfo.thirdjson.push(dataJosn[a].valueHdl);
              that.BfInfo.firstjson.push(dataJosn[a].valueTc);
              that.BfInfo.fourthjson.push(dataJosn[a].valueLdl);
              that.BfInfo.fifthjson.push(dataJosn[a].valueHcy);
              that.BfInfo.sixthjson.push(dataJosn[a].valueApoB);
              that.BfInfo.seventhjson.push(dataJosn[a].valueApoAI);
              that.BfInfo.data2.push(dataJosn[a].TestTime)
            }
            // 渲染 echart 曲线图
            var Chart = echarts.init(document.getElementById('chartbf'));
            var select = {
              'title' : {
                'text':'血脂(mmHg)',
                'textStyle':{
                  'color':'#b0b0b0',
                  'fontStyle':'normal',
                  'fontWeight':'lignter',
                  'fontSize':18
                }
              },
              'tooltip' : {
                'trigger': 'axis',
                formatter:function(params){
                  var str = ''
                  for( var i = 0; i < params.length; i++ ){
                    if( params.length === '0' ){
                      str += ""
                    }else{
                      if( !params[i].data ){
                        params[i].data = ""
                      }
                      str += params[i].marker+params[i].seriesName+":"+params[i].data+"<br>"
                    }
                  }
                  if( params.length === '0' ){
                    str += ""
                  }else{
                    params.push({
                      time : params[0].axisValue
                    })
                    str += '检查时间' + ':' + params[params.length-1].time
                  }
                  return str
                }
              },
              'calculable' : true,
              'grid':{
                'left':'3%',
                'right':'7%',
                'top':'10%',
                'bottom':'5%',
                'containLabel':true,
                'y2':50
              },
              'xAxis' : [{
                'type':'category',
                'data':that.BfInfo.data2,
                'axisLabel':{
                  'intreval':'auto',
                  'textStyle':{
                    'color':'black',
                    'fontSize':'14'
                  },
                  'formatter':function(value){
                    return value.slice(0,10)
                  }
                },
                'splitLine':{
                  'show':false
                },
                'axisLine':{
                  'lineStyle':{
                    'color':'#b6b6b6'
                  }
                },
                'axisTick':{
                  'show':false
                }
              }],
              'yAxis' : [
                {
                  'type':'value',
                  'axisLabel':{
                    'intreval':0,
                    'textStyle':{
                      'color':'black',
                      'fontSize':'16',
                      'shadowOffset':-5
                    }
                  },
                  'splitLine' : {
                    'show' : false
                  },
                  'axisLabel' : {
                    formatter: function(){
                      return "";
                    }
                  },
                  'axisLine':{
                    'lineStyle':{
                      'color':'#b6b6b6'
                    }
                  },
                  'axisTick':{
                    'show':false
                  }
                },
                {
                  'type':'value',
                  'splitLine' : {
                    'show' : false
                  },
                  'show':false,
                  'axisLabel':{
                    'intreval':0,
                    'textStyle':{
                      'color':'black',
                      'fontSize':'16',
                      'shadowOffset':-5
                    }
                  },
                  'axisLabel' : {
                    formatter: function(){
                      return "";
                    }
                  },
                  'axisLine':{
                    'lineStyle':{
                      'color':'#b6b6b6'
                    }
                  },
                  'axisTick':{
                    'show':false
                  }
                }
              ],
              'series' : [
                {
                  'name':'TC(总胆固醇)',
                  'type':'line',
                  'markLine':{
                    'symbol' : 'none',
                    'symbolSize' : [4, 2],
                    'itemStyle' : {
                      'normal': {
                        'lineStyle': {'color':'red'},
                        'barBorderColor':'red',
                        'label':{
                          'position':'left',
                          'textStyle':{'color':'black'}
                        }
                      }
                    },
                    'data':[
                      {
                        'yAxis':5.72,
                        'name':'5.72',
                        'itemStyle':{
                          'normal':{
                            'color':'#3a85ff'
                          }
                        }
                      }
                    ]
                  },
                  'data': that.BfInfo.firstjson,
                  'symbol':'circle',
                  'symbolSize':18,
                  'itemStyle':{
                    'normal':{
                      'color':'#00d2cb',
                      'lineStyle':{
                        'color':'#00d2cb'
                      }
                    }
                  }
                },
                {
                  'name':'TG(三酰甘油)',
                  'type':'line',
                  'markLine':{
                    'symbol' : 'none',
                    'symbolSize' : [4, 2],
                    'itemStyle' : {
                      'normal': {
                        'lineStyle': {'color':'red'},
                        'barBorderColor':'red',
                        'label':{
                          'position':'left',
                          // formatter:function(params){
                          //     return 100;
                          // },
                          'textStyle':{'color':'black'}
                        }
                      }
                    },
                    'data':[
                      {
                        'yAxis':1.7,
                        'name':'1.7',
                        'itemStyle':{
                          'normal':{
                            'color':'#3a85ff'
                          }
                        }
                      }
                    ]
                  },
                  'data': that.BfInfo.secondjson,
                  'symbol':'circle',
                  'symbolSize':18,
                  'itemStyle':{
                    'normal':{
                      'color':'#3a85ff',
                      'lineStyle':{
                        'color':'#3a85ff'
                      }
                    }
                  }
                },
                {
                  'name':'HDL-C(高密度脂蛋白胆固醇)',
                  'type':'line',
                  'markLine':{
                    'symbol' : 'none',
                    'symbolSize' : [4, 2],
                    'itemStyle' : {
                      'normal': {
                        'lineStyle': {'color':'red'},
                        'barBorderColor':'red',
                        'label':{
                          'position':'left',
                          // formatter:function(params){
                          //     return 100;
                          // },
                          'textStyle':{'color':'black'}
                        }
                      }
                    },
                    'data':[
                      {
                        'yAxis':1.56,
                        'name':'1.56',
                        'itemStyle':{
                          'normal':{
                            'color':'#3a85ff'
                          }
                        }
                      }
                    ]
                  },
                  'data': that.BfInfo.thirdjson,
                  'symbol':'circle',
                  'symbolSize':18,
                  'itemStyle':{
                    'normal':{
                      'color':'#625bf7',
                      'lineStyle':{
                        'color':'#625bf7'
                      }
                    }
                  }
                },
                {
                  'name':'LDL(低密度脂蛋白胆固醇)',
                  'type':'line',
                  'data': that.BfInfo.fourthjson,
                  'symbol':'circle',
                  'symbolSize':18,
                  'itemStyle':{
                    'normal':{
                      'color':'#2c88b8',
                      'lineStyle':{
                        'color':'#2c88b8'
                      }
                    }
                  }
                }
              ]
            };
            Chart.setOption(select);
            window.addEventListener("resize", function () {
              Chart.resize();
            })
          }
        }
      })
      // 获取当前点击是新增还是修改
      that.way = href.split('&')[1].split('=')[1];
      if( that.way == '' ){
        // 获取上一次的数据
        $.ajax({
          url:"${URL_PPPATIENTBASE_PATIENTDATA}",
          type:'get',
          dataType: "json",
          data:{
            idCard:that.idCard
          },
          success: function(data) {
            if( data.data != null ){
              that.bfData.bloodFat = data.data.bloodFat;
              that.bfData.highCholesterol = data.data.highCholesterol;
              that.bfData.cholesterol = data.data.cholesterol;
              that.bfData.lowCholesterol = data.data.lowCholesterol;
              that.bfData.triglyceride = data.data.triglyceride;
            }
          }
        })
      }
      // 获取病人基本信息
      $.ajax({
        url:"${URL_PATIENT_PATIENTINFO}",
        type:'post',
        dataType: "json",
        data:{
          idCard:that.idCard
        },
        success: function(data) {
          that.infor = data.data;
          that.id = that.infor.id;
          var href = that.infor.diseasesType
          that.infor.diseasesType = Type(that.infor.diseasesType)
          that.diseasesType = that.infor.diseasesType
          that.initMedicalTable()
        }
      })
      // 初始化获取随访信息
      $.ajax({
        url:"${URL_ACCOMPANY_BFDATA}",
        type:'post',
        dataType: "json",
        data:{
          id:that.way
        },
        success: function(data) {
          console.log(data)
          if( data.data ){
            that.bfData = data.data;
            that.bfData.interventionMethod = that.isNull(that.bfData.interventionMethod);
            that.showMoreCheck(that.interventionMethod,that.bfData.interventionMethod)
            that.bfData.proposal = that.isNull(that.bfData.proposal);
            that.showMoreCheck(that.proposal,that.bfData.proposal)
            $('#beginDate').val(that.bfData.accompanyTime)
            $('#nextDate').val(that.bfData.nextAccompanyTime)
          }else{
            // 初始化显示时间 随访时间
            var date = new Date().format('yyyy-MM-dd');
            that.bfData.accompanyTime = date
            $('#beginDate').val(that.bfData.accompanyTime)
             var date = new Date().format('yyyy-MM-dd');
                            // 获取年份
                            var year = date.slice(0,4)
                            // 获取月份
                            var month = date.slice(5,7)
                            if( parseInt(month) + 3 > 12 ){
                                month = parseInt(month) + 3 -12
                                year = parseInt(year) + 1
                            }else{
                                month = parseInt(month) + 3
                            }
                            if( String(month).length <= 1 ){
                                month = '0' + month
                            }
                            // debugger
                            // 获取日期
                            var day = date.slice(8,10);

                            if( parseInt(month) === 2 ){
                                if( parseInt(day) > 28 ){
                                  if (((year % 4)==0) && ((year % 100)!=0) || ((year % 400)==0)) {
                                    day = '29'
                                  }else{
                                    day = '28'
                                }
                              }
                            }else if( parseInt(month) === 4 || parseInt(month) === 6 || parseInt(month) === 9 || parseInt(month) === 11 ){
                                if( parseInt(day) > 30 ){
                                    day = '30';
                                }
                            }
                            var time = year + '-' + month + '-' + day
            that.bfData.nextAccompanyTime = time
            $('#nextDate').val(that.bfData.nextAccompanyTime)
          }
        }
      })
    }
  })
  $('#beginDate').bind('input propertychange',function(){
  })
</script>
</body>
</html>
